]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
mixer-stream: Allow to update port list
authorGuido Günther <agx@sigxcpu.org>
Sun, 4 Jan 2026 12:07:26 +0000 (13:07 +0100)
committerSimon McVittie <smcv@debian.org>
Wed, 28 Jan 2026 13:25:18 +0000 (13:25 +0000)
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Origin: https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/merge_requests/31
Bug: https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/issues/34
Bug-Debian: https://bugs.debian.org/1126514
Applied-upstream: gnome-shell 50, commit:798230599950607ec285daecd070f5bcb28580e4

Gbp-Pq: Topic libgvc
Gbp-Pq: Name mixer-stream-Allow-to-update-port-list.patch

subprojects/gvc/gvc-mixer-stream.c

index 038281772ca07de9ccae7cdf6ec38e800b1ab437..83963cc288c5a06fde9dda9c0b5c09b3ca9d3388 100644 (file)
@@ -624,9 +624,13 @@ gvc_mixer_stream_set_ports (GvcMixerStream *stream,
                             GList          *ports)
 {
         g_return_val_if_fail (GVC_IS_MIXER_STREAM (stream), FALSE);
-        g_return_val_if_fail (stream->priv->ports == NULL, FALSE);
 
-        stream->priv->ports = g_list_sort (ports, (GCompareFunc) sort_ports);
+        if (stream->priv->ports) {
+                g_list_free_full (stream->priv->ports, (GDestroyNotify) free_port);
+                stream->priv->ports = NULL;
+        }
+        if (ports)
+                stream->priv->ports = g_list_sort (ports, (GCompareFunc) sort_ports);
 
         return TRUE;
 }